#include <iostream>
#include <unistd.h>
#include <stdlib.h>
using namespace std;

int main(){
  cout << "begin..." << endl;
  cout << "begin..." << endl;
  cout << "begin..." << endl;
  cout << "begin..." << endl;
  cout << "I am a process, my pid is: " << getpid() << endl; 
  //直接进行程序替换
  execl("/bin/ls", "ls", "-a", "-l", NULL);
  
  cout << "end..." << endl;
  cout << "end..." << endl;
  cout << "end..." << endl;
  cout << "end..." << endl;

  return 0;
}
